JsonRpc
EOSIO Javascript / Exports / JsonRpc
Class: JsonRpc
Make RPC calls
Implements
Table of contents
Constructors
Properties
Methods
- db_size_get
- fetch
- getRawAbi
- getRequiredKeys
- get_abi
- get_account
- get_block
- get_block_header_state
- get_code
- get_currency_balance
- get_currency_stats
- get_info
- get_producer_schedule
- get_producers
- get_raw_code_and_abi
- get_scheduled_transactions
- get_table_by_scope
- get_table_rows
- history_get_actions
- history_get_controlled_accounts
- history_get_key_accounts
- history_get_transaction
- push_transaction
- send_transaction
- send_transaction2
Constructors
constructor
• new JsonRpc(endpoint, args?)
Parameters
| Name | Type | Description |
|---|---|---|
endpoint | string | |
args | Object | fetch: browsers: leave null or undefined * node: provide an implementation |
args.fetch? | (input?: string | Request, init?: RequestInit) => Promise<Response> | - |
Defined in
src/eosjs-jsonrpc.ts:31
Properties
endpoint
• endpoint: string
Defined in
src/eosjs-jsonrpc.ts:21
fetchBuiltin
• fetchBuiltin: (input?: string | Request, init?: RequestInit) => Promise<Response>
Type declaration
▸ (input?, init?): Promise<Response>
Parameters
| Name | Type |
|---|---|
input? | string | Request |
init? | RequestInit |
Returns
Promise<Response>
Defined in
src/eosjs-jsonrpc.ts:22
Methods
db_size_get
▸ db_size_get(): Promise<any>
Raw call to /v1/db_size/get
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:239
fetch
▸ fetch(path, body): Promise<any>
Post body to endpoint + path. Throws detailed error information in RpcError when available.
Parameters
| Name | Type |
|---|---|
path | string |
body | any |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:43
getRawAbi
▸ getRawAbi(accountName): Promise<BinaryAbi>
calls /v1/chain/get_raw_code_and_abi and pulls out unneeded raw wasm code
Parameters
| Name | Type |
|---|---|
accountName | string |
Returns
Promise<BinaryAbi>
Implementation of
AbiProvider.getRawAbi
Defined in
src/eosjs-jsonrpc.ts:123
getRequiredKeys
▸ getRequiredKeys(args): Promise<string[]>
Get subset of availableKeys needed to meet authorities in transaction. Implements AuthorityProvider
Parameters
| Name | Type |
|---|---|
args | AuthorityProviderArgs |
Returns
Promise<string[]>
Implementation of
AuthorityProvider.getRequiredKeys
Defined in
src/eosjs-jsonrpc.ts:185
get_abi
▸ get_abi(accountName): Promise<GetAbiResult>
Raw call to /v1/chain/get_abi
Parameters
| Name | Type |
|---|---|
accountName | string |
Returns
Promise<GetAbiResult>
Defined in
src/eosjs-jsonrpc.ts:67
get_account
▸ get_account(accountName): Promise<any>
Raw call to /v1/chain/get_account
Parameters
| Name | Type |
|---|---|
accountName | string |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:72
get_block
▸ get_block(blockNumOrId): Promise<GetBlockResult>
Raw call to /v1/chain/get_block
Parameters
| Name | Type |
|---|---|
blockNumOrId | string | number |
Returns
Promise<GetBlockResult>
Defined in
src/eosjs-jsonrpc.ts:82
get_block_header_state
▸ get_block_header_state(blockNumOrId): Promise<GetBlockHeaderStateResult>
Raw call to /v1/chain/get_block_header_state
Parameters
| Name | Type |
|---|---|
blockNumOrId | string | number |
Returns
Promise<GetBlockHeaderStateResult>
Defined in
src/eosjs-jsonrpc.ts:77
get_code
▸ get_code(accountName): Promise<GetCodeResult>
Raw call to /v1/chain/get_code
Parameters
| Name | Type |
|---|---|
accountName | string |
Returns
Promise<GetCodeResult>
Defined in
src/eosjs-jsonrpc.ts:87
get_currency_balance
▸ get_currency_balance(code, account, symbol?): Promise<any>
Raw call to /v1/chain/get_currency_balance
Parameters
| Name | Type | Default value |
|---|---|---|
code | string | undefined |
account | string | undefined |
symbol | string | null |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:92
get_currency_stats
▸ get_currency_stats(code, symbol): Promise<any>
Raw call to /v1/chain/get_currency_stats
Parameters
| Name | Type |
|---|---|
code | string |
symbol | string |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:97
get_info
▸ get_info(): Promise<GetInfoResult>
Raw call to /v1/chain/get_info
Returns
Promise<GetInfoResult>
Defined in
src/eosjs-jsonrpc.ts:102
get_producer_schedule
▸ get_producer_schedule(): Promise<any>
Raw call to /v1/chain/get_producer_schedule
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:107
get_producers
▸ get_producers(json?, lowerBound?, limit?): Promise<any>
Raw call to /v1/chain/get_producers
Parameters
| Name | Type | Default value |
|---|---|---|
json | boolean | true |
lowerBound | string | '' |
limit | number | 50 |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:112
get_raw_code_and_abi
▸ get_raw_code_and_abi(accountName): Promise<GetRawCodeAndAbiResult>
Raw call to /v1/chain/get_raw_code_and_abi
Parameters
| Name | Type |
|---|---|
accountName | string |
Returns
Promise<GetRawCodeAndAbiResult>
Defined in
src/eosjs-jsonrpc.ts:117
get_scheduled_transactions
▸ get_scheduled_transactions(json?, lowerBound?, limit?): Promise<any>
Raw call to /v1/chain/get_scheduled_transactions
Parameters
| Name | Type | Default value |
|---|---|---|
json | boolean | true |
lowerBound | string | '' |
limit | number | 50 |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:130
get_table_by_scope
▸ get_table_by_scope(__namedParameters): Promise<any>
Raw call to /v1/chain/get_table_by_scope
Parameters
| Name | Type |
|---|---|
__namedParameters | any |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:167
get_table_rows
▸ get_table_rows(__namedParameters): Promise<any>
Raw call to /v1/chain/get_table_rows
Parameters
| Name | Type |
|---|---|
__namedParameters | any |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:135
history_get_actions
▸ history_get_actions(accountName, pos?, offset?): Promise<any>
Raw call to /v1/history/get_actions
Parameters
| Name | Type | Default value |
|---|---|---|
accountName | string | undefined |
pos | number | null |
offset | number | null |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:242
history_get_controlled_accounts
▸ history_get_controlled_accounts(controllingAccount): Promise<any>
Raw call to /v1/history/get_controlled_accounts
Parameters
| Name | Type |
|---|---|
controllingAccount | string |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:257
history_get_key_accounts
▸ history_get_key_accounts(publicKey): Promise<any>
Raw call to /v1/history/get_key_accounts
Parameters
| Name | Type |
|---|---|
publicKey | string |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:252
history_get_transaction
▸ history_get_transaction(id, blockNumHint?): Promise<any>
Raw call to /v1/history/get_transaction
Parameters
| Name | Type | Default value |
|---|---|---|
id | string | undefined |
blockNumHint | number | null |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:247
push_transaction
▸ push_transaction(__namedParameters): Promise<any>
Push a serialized transaction (replaced by send_transaction, but returned format has changed)
Parameters
| Name | Type |
|---|---|
__namedParameters | PushTransactionArgs |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:193
send_transaction
▸ send_transaction(__namedParameters): Promise<any>
Send a serialized transaction
Parameters
| Name | Type |
|---|---|
__namedParameters | PushTransactionArgs |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:205
send_transaction2
▸ send_transaction2(__namedParameters): Promise<any>
Send a serialized transaction2
Parameters
| Name | Type |
|---|---|
__namedParameters | SendTransaction2Args |
Returns
Promise<any>
Defined in
src/eosjs-jsonrpc.ts:217